<?php

namespace app\home\controller;


use think\facade\App;
use think\facade\Request;

class Index extends Base {
    
    protected function initialize()
    {
        parent::initialize();
    }
    
    /**
     * @desc 首页
     */
    public function index() {
        return view();
    }
    
    /**
     * @desc 生成url链接
     */
    public function buildUrl() {
        $params['link']   = input('link');
    
        $logic = model('Index', 'logic');
        
        $data = [];
        try {
            $data = $logic->buildUrl($params, $this->userId);
        } catch (\Exception $e) {
            $logic->errorCode = EC_FAILURE;
            $logic->message = $e->getMessage();
        }
        return send_response($data, $logic->errorCode);
    }
}
